<template>
  <div class="more" @click="more">
    <span>...</span>
  </div>
  <div class="morebox" v-show="flag">
    <div class="box" @click="profileme">修改个人资料</div>
    <div class="box" @click="zx">注销</div>
    <div class="sanjiao"></div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
const emit = defineEmits(['profileme', 'more', 'zx'])
const flag = ref(false)
const more = () => {
  flag.value = !flag.value
  emit('more')
}
const profileme = () => {
  flag.value = false
  emit('profileme')
}
const zx = () => {
  flag.value = false
  emit('zx')
}
</script>

<style lang="scss" scoped>
.more {
  position: absolute;
  right: 0;
  top: 0;
  margin-right: 10px;
  margin-top: 10px;
  background-color: rgba(22, 24, 35, 0.6);
  width: 18px;
  height: 18px;
  padding: 6px;
  text-align: center;
  line-height: 18px;
  border-radius: 50%;
  z-index: 10;
  color: #fff;

  span {
    position: absolute;
    left: 0;
    top: 0;
    margin-left: 8px;
    font-size: 15px;
  }
}

.morebox {
  position: absolute;
  right: 0;
  top: 0;
  margin-top: 50px;
  margin-right: 10px;
  width: 80px;
  height: 88px;
  background: rgba(22, 24, 35, 0.6);
  display: flex;
  flex-direction: column;

  .box {
    width: 100%;
    height: 44px;
    font-size: 12px;
    color: #e8e8e9;
    text-align: center;
    line-height: 44px;
    z-index: 10;
  }

  .sanjiao {
    position: absolute;
    right: 0;
    top: 0;
    margin-top: -6px;
    margin-right: 9px;
    width: 0;
    height: 0;
    border-bottom: 7px solid rgba(22, 24, 35, 0.6);
    border-right: 7px solid transparent;
    border-left: 7px solid transparent;
  }
}
</style>